
package com.ctsi.security.domain;

import java.io.Serializable;

/**
 * @author gbk
 *
 */
public class RolePermission implements Serializable{
	private String id;
	private String roleId;
	private String permissionId;
	private String parentRoleId;
	/**
	 * 权限类型
	 */
	private String permisionType;
	/**
	 * 权限叶子类型
	 */
	private String permisionLeafType;
	
	private String permisionTypeName;
	private String type;
	
	public static final String TYPE_ROLE = "ROLE";
	public static final String TYPE_LOGINID = "LOGINID";
	
	/**
	 * 是否包含下级
	 */
	private String hasLower;
	public String toString(){
		return permissionId;
	}
	
	public String getParentRoleId() {
		return parentRoleId;
	}
	public void setParentRoleId(String parentRoleId) {
		this.parentRoleId = parentRoleId;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getRoleId() {
		return roleId;
	}
	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}
	public String getPermissionId() {
		return permissionId;
	}
	public void setPermissionId(String permissionId) {
		this.permissionId = permissionId;
	}
	public boolean hasLower(){
		return "true".equalsIgnoreCase(getHasLower());
	}
	
	public String getHasLower() {
		return hasLower;
	}
	public void setHasLower(String hasLower) {
		this.hasLower = hasLower;
	}
	public String getPermisionType() {
		return permisionType;
	}
	public void setPermisionType(String permisionType) {
		this.permisionType = permisionType;
	}
	public String getPermisionTypeName() {
		return permisionTypeName;
	}
	public void setPermisionTypeName(String permisionTypeName) {
		this.permisionTypeName = permisionTypeName;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	
	public int hashCode(){		
		return new StringBuilder().append(permissionId).append("|||").append(permisionType==null?"":permisionType).toString().hashCode();
	}
	public String getPermisionLeafType() {
		return permisionLeafType;
	}
	public void setPermisionLeafType(String permisionLeafType) {
		this.permisionLeafType = permisionLeafType;
	}
	

}
